package link.xieyu.controller;

import io.swagger.annotations.ApiOperation;
import link.xieyu.mapper.AppUsersMapper;
import link.xieyu.pojo.AppUsers;
import link.xieyu.service.UsersService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author xieyu
 */
@RestController
@RequestMapping("app/user")
@RequiredArgsConstructor
public class UsersController {
    private final UsersService usersService;
    @ApiOperation("修改用户信息")
    @GetMapping("update")
    public ResponseEntity<Object> update(AppUsers users) {
        users.setUpdateTime(new Date());
        usersService.update(users);
        return ResponseEntity.ok().build();
    }


}
